package com.augurit.gzcgwsp.ljzyz.convert;

import org.dozer.DozerBeanMapper;

import com.augurit.gzcgwsp.ljzyz.entity.YwYnBusinfo;
import com.augurit.gzcgwsp.ljzyz.entity.YwYnBustransfer;
import com.augurit.gzcgwsp.ljzyz.web.form.YwYnBustransferForm;

public class YwYnBustransferConvertor {
	public static YwYnBustransfer convertTotransfer(YwYnBusinfo bus) {
		if(bus != null) {
			YwYnBustransfer entity =new DozerBeanMapper().map(bus, YwYnBustransfer.class);
			entity.setBusid(bus.getId());
			entity.setId(null);
			return entity;
		}else
			return null;
	}
	
	public static void convertFormToVo(YwYnBustransferForm form, YwYnBustransfer entity) {
		if (form == null) return;
        if (entity == null) entity = new YwYnBustransfer();
        
        new DozerBeanMapper().map(form, entity);
	}
	
}